<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #box {
        display: flex;
        font-size: 40px;
        margin: 100px 0 0 200px;
      }
      #box div {
        width: 100px;
        height: 100px;
        background-color: beige;
        display: flex;
        align-items: center;
        justify-content: center;
        border: solid;
      }
    </style>
  </head>
  <body>
    <div id="box">
      <div>1</div>
      <div>2</div>
      <div>3</div>
    </div>

    <script>
      const divs = document.querySelectorAll("#box div");

      divs[0].onmouseover = () => console.log("onmouseover1");
      // divs[0].onmouseout = () => console.log("onmouseout1");

      divs[1].onmouseover = () => console.log("onmouseover2");
      // divs[2].onmouseout = () => console.log("onmouseout2");

      divs[2].onmouseover = () => console.log("onmouseover3");
      // divs[2].onmouseout = () => console.log("onmouseout3");
    </script>
  </body>
</html>
